﻿using Microsoft.AspNetCore.Mvc;
using ZhCun.RightsManage.BLL;
using ZhCun.Utils;
using ZhCun.WebUtils;
using ZhCun.WebUtils.DB;

namespace ZhCun.RightsManage.ApiControllers
{
    public class ApiUserController : BaseApiUserController<UserBLL>
    {
        /// <summary>
        /// api登录
        /// </summary>
        [UserAuthorize(false)]
        [Route("/api/login")]
        [HttpPost]
        [BodyEncryptFilter]
        public ApiResult LoginApi(UserLoginArg arg)
        {
            return Login(arg, 1);
        }

        /// <summary>
        /// api登录
        /// </summary>
        [UserAuthorize(false)]
        [Route("/page/login")]
        [BodyEncryptFilter]
        [HttpPost]
        //[SwaggerHidden]
        public ApiResult LoginPage(UserLoginArg arg)
        {
            return Login(arg, 0);
        }
    }
}